home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6029 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: strings.h
  5. Date: 21 Feb 1996 13:00:00 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4gg14gINNr9o@keats.ugrad.cs.ubc.ca>
  8. References: <4gao9h$7g2@news.bu.edu> <danpop.824774837@rscernix>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <danpop.824774837@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
  12. >In <4gao9h$7g2@news.bu.edu> lachesis@cs.bu.edu (wai yip) writes:
  13. >
  14. >>can anyone who has the header file strings.h please email me and tell me
  15. >>what is in it or just mail me the header file?
  16. >
  17. >I will violate some copyrights and post the version on my system, without
  18. >omitting a single byte :-)
  19.  
  20. [ snip ]
  21.  
  22. >    /*
  23. >     * OSF/1 Release 1.0
  24. >     */
  25. >
  26. >    #include <string.h>
  27. >
  28. >That's it.  Hope DEC and/or IBM won't sue me :-)
  29.  
  30. That's pretty funny.
  31.  
  32. Normally, <strings.h> is supposed to declare certain BSD-specific functions
  33. that are not part of the C standard. These include things like index() and
  34. rindex() which are basically identical to the standard strchr() and strrchr(),
  35. respectively.
  36.  
  37. On many modern UNIX systems, the declarations are combined into one file, and
  38. strings.h just includes string.h. Under Linux, the BSD-specific declarations in
  39. string.h are passed through only if the special switch __USE_BSD is defined.
  40.  
  41. There is no need to use index() or rindex(), except when you need to compile
  42. on some old BSD-derived system that predates the standardization.
  43.  
  44. A lot of socket code traditionally uses bcopy(), bzero() and friends, the idea
  45. being that these functions are present in any environment where the socket
  46. calls are.
  47. -- 
  48.  
  49.